package com.gx.smart.construction.ui.common.viewmodel;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;

import com.gx.smart.base.BaseViewModel;
import com.gx.smart.construction.ui.common.model.AreaName;
import com.gx.smart.construction.ui.common.model.BuildingName;
import com.gx.smart.construction.ui.common.model.RoomName;
import com.gx.smart.construction.ui.common.model.UnitName;

/**
 * @author: xiaosy
 * 时间: 2022/1/17
 * @Description: 记录选择的分区-楼栋-单元-房间-编号信息
 * 在fragment回退栈中恢复这些信息
 * @Version: 1.0
 **/
public class SelectRoomViewModel extends BaseViewModel {
    private MutableLiveData<AreaName> areaName = new MutableLiveData<>();
    private MutableLiveData<BuildingName> buildingName = new MutableLiveData<>();
    private MutableLiveData<UnitName> unitName = new MutableLiveData<>();
    private MutableLiveData<RoomName> roomName = new MutableLiveData<>();
    private MutableLiveData<String> sn = new MutableLiveData<>();
    private MutableLiveData<String> totalProgress = new MutableLiveData<>();

    public SelectRoomViewModel(@NonNull Application application) {
        super(application);
    }

    public LiveData<AreaName> getAreaName() {
        return areaName;
    }

    public void changeAreaName(AreaName areaName) {
        this.areaName.setValue(areaName);
    }


    public LiveData<BuildingName> getBuildingName() {
        return buildingName;
    }

    public void changeBuildingName(BuildingName buildingName) {
        this.buildingName.setValue(buildingName);
    }

    public LiveData<UnitName> getUnitName() {
        return unitName;
    }

    public void changeUnitName(UnitName unitName) {
        this.unitName.setValue(unitName);
    }

    public LiveData<RoomName> getRoomName() {
        return roomName;
    }

    public void changeRoomName(RoomName roomName) {
        this.roomName.setValue(roomName);
    }

    public LiveData<String> getSn() {
        return sn;
    }

    public void changeSn(String sn) {
        this.sn.setValue(sn);
    }

    public void changeTotalProgress(String totalProgress){
        this.totalProgress.setValue(totalProgress);
    }

    public LiveData<String> getTotalProgress() {
        return this.totalProgress;
    }
}
